/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.repair.service;

import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.repair.dto.PlanCheckStatisticsQueryDTO;
import org.springblade.modules.repair.dto.PlanUserSignCountDTO;
import org.springblade.modules.repair.entity.MaintainSign;
import org.springblade.modules.repair.vo.ElevatorLastPlanVO;
import org.springblade.modules.repair.vo.PlanSignCheckVO;
import org.springblade.modules.repair.vo.PlanSignVO;

import java.util.HashMap;
import java.util.List;

/**
 * 维保签到明细 服务类
 *
 * @author BladeX
 * @since 2021-05-21
 */
public interface IMaintainSignService extends BaseService<MaintainSign> {

	/**
	 * 新增签名
	 * @param maintainSign 签名实体
	 * @return 数据集
	 */
    Boolean sign(MaintainSign maintainSign);

	Boolean signOut(MaintainSign maintainSign);

	List<PlanSignVO> listPlanSign(Long planId);

	HashMap<String,Object> signPlanCheck(Long userId,Long planId);

	Boolean checkUserLastSign(MaintainSign maintainSign);

	void checkUserSignOut(Long planId);

	/**
	 * 维修/配件工单24未签退，执行系统代签
	 * @param maintainSignId
	 * @param planId
	 * @param typeStatus
	 */
	void wxPartsAutoSignOut(Long maintainSignId, Long planId, Integer typeStatus);

	PlanUserSignCountDTO countUserSignError(Long planId, Long userId);

    List<MaintainSign> listByUserDate(PlanCheckStatisticsQueryDTO queryDTO, List<Long> userIds);

	List<MaintainSign> listCommitByUserDate(PlanCheckStatisticsQueryDTO queryDTO, List<Long> userIds);

	ElevatorLastPlanVO selectUserLastSignImgByElevator(Long userId, Long elevatorId);

    Boolean offlineSign(MaintainSign sign);

	/**
	 * 根据当前工单id, 获取当前用户 当前这一类型工单的 签退情况
	 * @param planId 当前工单id
	 * @return 签退情况
	 */
	PlanSignCheckVO planSignOutCheck(Long planId);

	/**
	 * @Author lsay
	 * @Description {
	 *   获取未签退保养工单签到记录
	 * }
	 * @Date 9:55 2024/6/4
	 * @Param planId 需要排除的保养工单（无参查所有） userId 用户id
	 * @return
	 **/
    List<MaintainSign> listByPlanUserNotSignOut(Long planId, Long userId);
}
